//
//  DirectMessage.swift
//  WeiBoOfSwift
//
//  Created by aven wu on 08/05/2018.
//  Copyright © 2018 GML. All rights reserved.
//

import UIKit

class DirectMessage: NSObject {
    @objc var text:String?
    var sender_screen_name:String?
    /// 微博创建时间
    @objc var created_at: String?
        {
        didSet{
            //  created_at = "Sun Sep 12 14:50:57 +0800 2014"
            // 1.将字符串转换为时间
            let createdDate = NSDate.dateWithStr(time: created_at!)
            // 2.获取格式化之后的时间字符串
            created_at = createdDate.descDate
        }
    }

    // 字典转模型
    init(dict: [String: AnyObject])
    {
        super.init()
        setValuesForKeys(dict)
    }
    
    override func setValue(_ value: Any?, forUndefinedKey key: String) {
        
    }
    // 打印当前模型
    var properties = ["text", "sender_screen_name"]
    override var description: String {
        let dict = dictionaryWithValues(forKeys: properties)
        return "\(dict)"
    }
}
